<!-- sunsblog.net CMS blog.inc (c) 2004-2007 6jokica Zafirovski -->
<td width="200" valign="top">
<div>
<span class="blog-text">
<?php
openConnection();

if($month == "") {
$dateComponents = getdate();

$month = $dateComponents['mon'];
$year = $dateComponents['year'];
$datumot = date("Y-m-d");
}
//$query = "SELECT dayofmonth(blogDate) as blogDate FROM sunsblogs";
$query = "SELECT blogDate FROM sunsblogs";
$result = mysql_query($query)
     or die("no data");
//die ($result);
while ($row = mysql_fetch_array($result)) {
  if(!$row) {
   //die($row['blogDate']);
   $dateArray[] = "";
  } else {
    //die($row['blogDate']);
    $dateArray[] = $row['blogDate'];
  }
}
//die ($dateArray[2]);
echo "<table width='150' cellspacing='1' cellpadding='0' align='center'>
<tr>
<td colspan='2'>
<a href='index.php?s_id=63&l_id=5'><img alt='AcouSunStic Dvd' src='images/dvd_najava.jpg' /></a>
</td>
</tr>
<tr><td colspan='2' class='podnaslov'>&nbsp;</td></tr>
<!--
<tr> 
<td colspan='2'>
<a href='index.php?s_id=58&l_id=2'><img alt='podcast' src='images/podcast_banner.jpg' /></a>
</td>
</tr>
<tr><td colspan='2' class='podnaslov'>&nbsp;</td></tr>
-->
<tr>
<td colspan='2'><a href='index.php?s_id=38&l_id=3'><img src='images/inc_prag.jpg' border='0' width='150' height='150' /></a></td>
</tr>
<tr>
<td><a href='javascript:newWindow(\"obj\", \"players/suns_prag_player.php\", \"300\", \"300\", \"no\");void(0);'><img alt='Slusaj go singlot Prag' src='images/inc_slusaj.gif' border='0' width='75' height='14' /></a></td>
<td><a href='index.php?s_id=44&l_id=5'><img alt='Video' src='images/inc_video.gif' border='0' width='75' height='14' /></a></td>
</tr>
<tr><td colspan='2'><img src='images/spacer.gif' border='0' width='1' height='5' /></td></tr>
<tr><td colspan='2' class='podnaslov'>&nbsp;</td></tr>
<tr>
<td colspan='2'><a href='index.php?s_id=25&l_id=3'><img src='images/inc_msesm.jpg' border='0' width='150' height='150' /></a></td>
</tr>
<tr>
<td><a href='javascript:newWindow(\"obj\", \"players/suns_msesm_player.php\", \"300\", \"300\", \"no\");void(0);'><img alt='Slusaj go albumot Mojot Son e Samo Moj' src='images/inc_slusaj.gif' border='0' width='75' height='14' /></a></td>
<td><a href='index.php?s_id=17&l_id=5'><img alt='Video' src='images/inc_video.gif' border='0' width='75' height='14' /></a></td>
</tr>
<tr><td colspan='2'><img src='images/spacer.gif' border='0' width='1' height='5' /></td></tr>
<tr>
<td colspan='2' align='center'>
<br/>
<a href='sunsrss.php'><img alt='rss feed' src='images/rss_icon.jpg' /></a>
</td>
</tr>

</table>";

echo build_calendar($month,$year,$dateArray);

if (isset ($_GET['date'])) { 

  $date = $_GET['date']; 

} else { 

  $date = date("Y-m-d"); 

}

echo "<table width='150'>
<tr><td><p class='podnaslov'><a href='blog.php?date=".$datumot."'>Постави Sunsblog</a></p><p class='podnaslov'>Блогирано на ".datum($datumot)."</p>";

$blogQuery = "SELECT title, content, user_id FROM sunsblogs WHERE blogDate = '$datumot' limit 3";
$blogResult = mysql_query($blogQuery);
if (mysql_numrows($blogResult) > 0) {
	while (list($title,$content,$user_id) =
	 mysql_fetch_row($blogResult)) {
	 
	 $userQuery = "select ime, prezime,suns from sunsers where id='$user_id'";
	 $userResult = mysql_query($userQuery);
	 $userRow = mysql_fetch_array($userResult);
	 $ime = $userRow['ime'];
	 $prezime = $userRow['prezime'];
         if($userRow['suns'] == 2){
           $ime = 'sunsblog';
           $prezime ='';
         }

    echo "<p class='podnaslov'><b>$title</b><br>$content<br><span style='color:666666'>$ime&nbsp;$prezime</span></p>";

  }

} else {

  echo "<p class='cetivo'>Денес сеуште нема блог.</a>";

}

echo "</td></tr></table>";

?>

</span>
</div>
</td>
</tr>
